package com.cy.common.pojo;

import java.io.Serializable;

import lombok.Data;

/**
 * 此类用于封装状态和数据信息返回给前端页面
 * @author private
 *
 */
@Data
public class JsonResult implements Serializable{
	private static final long serialVersionUID = -5357317428264084021L;
	//状态码,1为正常,0为异常
	private Integer state = 1;
	//状态描述
	private String message = "OK";
	//回传数据
	private Object data;
	
	public JsonResult() {
		
	}
	
	public JsonResult(String message) {
		this.message = message;
	}
	
	public JsonResult(Object data) {
		this.data = data;
	}
	
	public JsonResult(Throwable e) {
		this.state = 0;
		this.message = e.getMessage();
	}
	
}
